<!DOCTYPE html>
<html lang="zh_CN" xmlns:th="http://www.thymeleaf.org" >
<meta charset="utf-8">
<head th:include="common/include :: header"></head>
<body class="gray-bg">
<div class="ibox float-e-margins">
    <div class="ibox-content">
        <form class="form-horizontal m-t" id="userInfoForm">
            <div class="row">
                <div class="col-sm-6 b-r">
                    <input id="id" name="id" type="hidden" th:value="${user.id}">

                    <div class="form-group" underline="true">
                        <label class="col-sm-3 control-label">用户名</label>
                        <div class="col-sm-8">
                            <input id="username" name="username" class="form-control" type="text" readonly="readonly" th:value="${user.username}">
                        </div>
                    </div>
                    <div class="hr-line-dashed"></div>

                    <div class="form-group" underline="true">
                        <label class="col-sm-3 control-label">性别</label>
                        <div class="col-sm-8">
                            <!--<label class="radio-inline"> <input th:field="*{user.sex}" type="radio" name="sex" value="1" /> 男 </label>-->
                            <!--<label class="radio-inline"> <input th:field="*{user.sex}" type="radio" name="sex" value="2" /> 女 </label>-->
                            <select class="form-control m-b" id="sex" name="sex" th:field="${user.sex}" th:switch="${user.sex.toString()}">
                                <option value="1" th:selected="selected">男</option>
                                <option value="2" th:selected="selected">女</option>
                            </select>
                        </div>
                    </div>
                    <div class="hr-line-dashed"></div>

                    <!--<div class="form-group" underline="true">-->
                        <!--<label class="col-sm-3 control-label">密码</label>-->
                        <!--<div class="col-sm-8">-->
                            <!--<input id="password" name="password"  class="form-control" type="password" readonly="readonly" value="******">-->
                        <!--</div>-->
                    <!--</div>-->
                    <!--<div class="hr-line-dashed"></div>-->

                    <div class="form-group" underline="true">
                        <label class="col-sm-3 control-label">部门</label>
                        <div class="col-sm-8">
                            <input id="deptid" name="deptid" class="hidden" th:value="${user.deptid}">
                            <input id="deptName" name="deptName" class="form-control" type="text"
                                style="cursor: pointer;" onclick="openDept()"
                                readonly="readonly" placeholder="所属部门" th:value="${deptName}">
                        </div>
                    </div>
                    <div class="hr-line-dashed"></div>

                    <div class="form-group" underline="true">
                        <label class="col-sm-3 control-label">E-mail</label>
                        <div class="col-sm-8">
                            <input id="email" name="email" class="form-control" type="email" th:value="${user.email}">
                        </div>
                    </div>
                    <div class="hr-line-dashed"></div>

                    <div class="form-group">
                        <div class="col-sm-8 col-sm-offset-3">
                            <button type="submit" class="btn btn-primary" icon="fa-eraser">提交</button>
                            <button class="btn btn-danger"  icon="fa-eraser" onclick="fclose()">取消</button>
                        </div>
                    </div>
                </div>

                <div class="col-sm-6 b-r">
                    <div class="form-group" underline="true">
                        <label class="col-sm-3 control-label">姓名</label>
                        <div class="col-sm-8">
                            <input id="realname" name="realname" class="form-control" type="text" th:value="${user.realname}">
                        </div>
                    </div>
                    <div class="hr-line-dashed"></div>

                    <div class="form-group">
                        <label class="col-sm-3 control-label">出生日期</label>
                        <div class="col-sm-8">
                            <input id="birthday" class="laydate-icon form-control layer-date" th:value="${#dates.format(user.birthday, 'yyyy-MM-dd')}">
                        </div>
                    </div>
                    <div class="hr-line-dashed"></div>

                    <!--<div class="form-group" underline="true">-->
                        <!--<label class="col-sm-3 control-label">确认密码</label>-->
                        <!--<div class="col-sm-8">-->
                            <!--<input id="rePassword" name="rePassword"  class="form-control" type="password" readonly="readonly" value="******">-->
                        <!--</div>-->
                    <!--</div>-->
                    <!--<div class="hr-line-dashed"></div>-->

                    <div class="form-group"  underline="true">
                        <label class="col-sm-3 control-label">角色</label>
                        <div class="col-sm-8">
                            <!--<input id="roleid" type="text" class="form-control" readonly="readonly" th:value="${roleName}">-->
                            <input id="roleid" name="roleid" class="hidden" th:value="${user.roleid}">
                            <input id="roleName" name="roleName" class="form-control" type="text"
                                   style="cursor: pointer;" onclick="openRole()"
                                   readonly="readonly" placeholder="赋予角色" th:value="${roleName}">
                        </div>
                    </div>
                    <div class="hr-line-dashed"></div>

                    <div class="form-group" underline="true">
                        <label class="col-sm-3 control-label">电话</label>
                        <div class="col-sm-8">
                            <input id="phone" type="text" class="form-control" th:value="${user.phone}">
                        </div>
                    </div>
                    <div class="hr-line-dashed"></div>

                </div>
            </div>
        </form>
    </div>
</div>

<div th:include="common/include::footer"></div>
<script>
    //外部js调用
    laydate({
        elem: '#birthday', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎，因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
        event: 'focus' //响应事件。如果没有传入event，则按照默认的click
    });
</script>
<script type="text/javascript" th:src="@{/project/user/user_edit.js}"></script>
</body>
</html>
